package cn.stylefeng.guns.sys.modular.system.service;

import cn.stylefeng.guns.base.pojo.page.LayuiPageFactory;
import cn.stylefeng.guns.sys.modular.system.entity.BtyWlYfmx;
import cn.stylefeng.guns.sys.modular.system.mapper.BtyWlYfmxMapper;
import cn.stylefeng.guns.sys.modular.system.model.params.CheciParam;
import cn.stylefeng.roses.core.util.ToolUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 通知表 服务实现类
 * </p>
 */
@Service
public class BtyWlYfmxService extends ServiceImpl<BtyWlYfmxMapper, BtyWlYfmx> {
    /**
     * 获取运费明细列表
     */
    public Page<Map<String, Object>> list(CheciParam checiParam) {
        //拼接查询条件
        String beginTime = "";
        String endTime = "";
        if (ToolUtil.isNotEmpty(checiParam.getTimeLimit())) {
            String[] split = checiParam.getTimeLimit().split(" - ");
            beginTime = split[0];
            endTime = split[1] + " 23:59:59";
            checiParam.setBeginTime(beginTime);
            checiParam.setEndTime(endTime);
        }
        Page page = LayuiPageFactory.defaultPage();
        return this.baseMapper.list(page, checiParam);
    }
    public Page<Map<String, Object>> getPslxByDm(CheciParam checiParam){
        Page page = LayuiPageFactory.defaultPage();
        return baseMapper.getPslxByDm(page,checiParam);
    }
    public List<Map<String, Object>> listExport(CheciParam checiParam) {
        //拼接查询条件
        String beginTime = "";
        String endTime = "";
        if (ToolUtil.isNotEmpty(checiParam.getTimeLimit())) {
            String[] split = checiParam.getTimeLimit().split(" - ");
            beginTime = split[0];
            endTime = split[1] + " 23:59:59";
            checiParam.setBeginTime(beginTime);
            checiParam.setEndTime(endTime);
        }
        return this.baseMapper.listExport(checiParam);
    }
}
